package org.grayrabbit.cloud.core.server.module;

import java.util.Map;

import org.grayrabbit.cloud.core.biz.BizAbstractModule;
import org.grayrabbit.cloud.core.biz.BizArgument;
import org.grayrabbit.cloud.core.biz.BizResult;
import org.grayrabbit.cloud.core.biz.ServerUtility;
import org.grayrabbit.cloud.core.module.ModuleException;
import org.grayrabbit.cloud.core.rpc.Argument;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class LoginModule extends BizAbstractModule {
	
	private static Logger logger = LoggerFactory.getLogger(LoginModule.class);
	
	public BizResult submit(Argument argument) throws ModuleException {
		logger.debug("内容管理模块接口接收处理...");
		
		if(argument instanceof BizArgument){
			BizArgument arg = (BizArgument) argument;
			logger.debug("当前参数命令：{}",arg.getCommand());
			Map<String,String> cps  = arg.getCmdParams();
			for (String key : cps.keySet()) {
				logger.debug("当前参数key:{},当前参数value:{}",key,cps.get(key));
			}
		logger.debug("我要调内容管理模块接口");
		BizResult bizResult=(BizResult)ServerUtility.getModule("spring").submit(argument);
		logger.debug("接口返回值：{}",bizResult);
		return bizResult;
		}
		return BizResult.NULL;
	}
}
